<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class test_results</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Test">
<link rel="up" href="../../header/boost/test/results_collector_hpp.html" title="Header &lt;boost/test/results_collector.hpp&gt;">
<link rel="prev" href="results_collector_t.html" title="Class results_collector_t">
<link rel="next" href="../../header/boost/test/results_reporter_hpp.html" title="Header &lt;boost/test/results_reporter.hpp&gt;">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="results_collector_t.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/test/results_collector_hpp.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../header/boost/test/results_reporter_hpp.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.unit_test.test_results"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class test_results</span></h2>
<p>boost::unit_test::test_results — Collection of attributes constituting test unit results. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../header/boost/test/results_collector_hpp.html" title="Header &lt;boost/test/results_collector.hpp&gt;">boost/test/results_collector.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="test_results.html" title="Class test_results">test_results</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="test_results.html#boost.unit_test.test_resultsconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="test_results.html#idm45845-bb"><span class="identifier">test_results</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="test_results.html#idm45784-bb">public member functions</a></span>
  <span class="keyword">typedef</span> <a class="link" href="test_results.html#idm45785-bb"><span class="identifier">BOOST_READONLY_PROPERTY</span></a><span class="special">(</span><span class="identifier">counter_t</span><span class="special">,</span> 
                                  <span class="special">(</span><a class="link" href="results_collector_t.html" title="Class results_collector_t">results_collector_t</a><span class="special">)</span><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a><span class="special">)</span><span class="special">(</span><span class="identifier">results_collect_helper</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">typedef</span> <a class="link" href="test_results.html#idm45794-bb"><span class="identifier">BOOST_READONLY_PROPERTY</span></a><span class="special">(</span><span class="keyword">bool</span><span class="special">,</span> 
                                  <span class="special">(</span><a class="link" href="results_collector_t.html" title="Class results_collector_t">results_collector_t</a><span class="special">)</span><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a><span class="special">)</span><span class="special">(</span><span class="identifier">results_collect_helper</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="test_results.html#idm45803-bb"><span class="identifier">passed</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="test_results.html#idm45806-bb"><span class="identifier">skipped</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="test_results.html#idm45811-bb"><span class="identifier">aborted</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">int</span> <a class="link" href="test_results.html#idm45814-bb"><span class="identifier">result_code</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="test_results.html#idm45832-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="test_results.html#idm45842-bb"><span class="identifier">clear</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_suites</span><span class="special">;</span>  <span class="comment">// Number of test suites. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_assertions_passed</span><span class="special">;</span>  <span class="comment">// Number of successful assertions. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_assertions_failed</span><span class="special">;</span>  <span class="comment">// Number of failing assertions. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_warnings_failed</span><span class="special">;</span>  <span class="comment">// Number of warnings. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_expected_failures</span><span class="special">;</span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_passed</span><span class="special">;</span>  <span class="comment">// Number of successfull test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_warned</span><span class="special">;</span>  <span class="comment">// Number of warnings in test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_failed</span><span class="special">;</span>  <span class="comment">// Number of failing test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_skipped</span><span class="special">;</span>  <span class="comment">// Number of skipped test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_aborted</span><span class="special">;</span>  <span class="comment">// Number of aborted test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_cases_timed_out</span><span class="special">;</span>  <span class="comment">// Number of timed out test cases. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_test_suites_timed_out</span><span class="special">;</span>  <span class="comment">// Number of timed out test suites. </span>
  <span class="identifier">counter_prop</span> <span class="identifier">p_duration_microseconds</span><span class="special">;</span>  <span class="comment">// Duration of the test in microseconds. </span>
  <span class="identifier">bool_prop</span> <span class="identifier">p_aborted</span><span class="special">;</span>  <span class="comment">// Indicates that the test unit execution has been aborted. </span>
  <span class="identifier">bool_prop</span> <span class="identifier">p_skipped</span><span class="special">;</span>  <span class="comment">// Indicates that the test unit execution has been skipped. </span>
  <span class="identifier">bool_prop</span> <span class="identifier">p_timed_out</span><span class="special">;</span>  <span class="comment">// Indicates that the test unit has timed out. </span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm55564"></a><h2>Description</h2>
<p>This class is a collection of attributes describing a test result.</p>
<p>The attributes presented as public properties on an instance of the class. In addition summary conclusion methods are presented to generate simple answer to pass/fail question </p>
<div class="refsect2">
<a name="idm55568"></a><h3>
<a name="boost.unit_test.test_resultsconstruct-copy-destruct"></a><code class="computeroutput">test_results</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><a name="idm45845-bb"></a><span class="identifier">test_results</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
<div class="refsect2">
<a name="idm55581"></a><h3>
<a name="idm45784-bb"></a><code class="computeroutput">test_results</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typedef</span> <a name="idm45785-bb"></a><span class="identifier">BOOST_READONLY_PROPERTY</span><span class="special">(</span><span class="identifier">counter_t</span><span class="special">,</span> 
                                <span class="special">(</span><a class="link" href="results_collector_t.html" title="Class results_collector_t">results_collector_t</a><span class="special">)</span><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a><span class="special">)</span><span class="special">(</span><span class="identifier">results_collect_helper</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Type representing counter like public property. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typedef</span> <a name="idm45794-bb"></a><span class="identifier">BOOST_READONLY_PROPERTY</span><span class="special">(</span><span class="keyword">bool</span><span class="special">,</span> 
                                <span class="special">(</span><a class="link" href="results_collector_t.html" title="Class results_collector_t">results_collector_t</a><span class="special">)</span><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a><span class="special">)</span><span class="special">(</span><span class="identifier">results_collect_helper</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Type representing boolean like public property. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45803-bb"></a><span class="identifier">passed</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns true if test unit passed. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45806-bb"></a><span class="identifier">skipped</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns true if test unit skipped. <p>For test suites, this indicates if the test suite itself has been marked as skipped, and not if the test suite contains any skipped test. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45811-bb"></a><span class="identifier">aborted</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns true if the test unit was aborted (hard failure) </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">int</span> <a name="idm45814-bb"></a><span class="identifier">result_code</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Produces result code for the test unit execution. <p>This methhod return one of the result codes defined in <code class="computeroutput">boost/cstdlib.hpp</code> 
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><code class="computeroutput">boost::exit_success</code> on success,</p></li>
<li class="listitem"><p><code class="computeroutput">boost::exit_exception_failure</code> in case test unit was aborted for any reason (including uncaught exception)</p></li>
<li class="listitem"><p>and <code class="computeroutput">boost::exit_test_failure</code> otherwise </p></li>
</ul></div>
<p>
</p>
</td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm45832-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><a class="link" href="test_results.html" title="Class test_results">test_results</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>Combines the results of the current instance with another. <p>Only the counters are updated and the <code class="computeroutput">p_aborted</code> and <code class="computeroutput">p_skipped</code> are left unchanged. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm45842-bb"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Resets the current state of the result. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2022 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="results_collector_t.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/test/results_collector_hpp.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../header/boost/test/results_reporter_hpp.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
